<?php
use App\Models\Order;
use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

// Route::get('/user', function (Request $request) {
//     return $request->user();
// })->middleware('auth:api');
Route::get('/getalldata/','ApiController@getalldata');
Route::get('/getdata/{symbol}','ApiController@getdata');
Route::get('/getdata/{symbol}','ApiController@getdata');

// Route::get('/getdata/{symbol}', function ($symbol) {
//      $data = get_option_data($symbol);
//      echo json_encode($data);
     
// });

Route::get('/getperioddata/{symbol}','ApiController@getperioddata');
// Route::get('/getperioddata/{symbol}', function ($symbol) {
//      $data = get_period_data($symbol);
//      //echo $data;
//      echo json_encode($data);
//      //var_dump($data);
// });
Route::get('/getklinedata/{symbol}/{time}/{return_t}','ApiController@getklinedata');
// Route::get('/getklinedata/{symbol}/{time}', function ($symbol,$time) {
//      $data = get_k_data($symbol,$time);
//      //echo $data;
//      echo json_encode($data);
//      //var_dump($data);
// });
Route::get('/getorderdata/{id}','ApiController@getorderdata');
// Route::get('/getorderdata/{id}', function ($id) {
//      $data = Order::where('id','=',$id)->first();
//      //echo $data;
//      echo json_encode($data);
//      //var_dump($data);
// });

Route::group(['namespace' => 'Admin\Wechat'], function () {
    Route::any('/wechat', 'WechatController@serve');
});

Route::group(['namespace' => 'Home'], function () {
    Route::any('/wxpaynotify','MemberController@wxPayNotify');
    Route::any('/zfnotify','MemberController@zfnotify');
    Route::any('/gzzhnotify','MemberController@gzzhnotify');
    Route::any('/xysmnotify','MemberController@xysmNotify');
});
